/*********************************************************
          File Name:10.27.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 14 Mar 2016 07:05:25 PM CST
**********************************************************/

#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <iterator>

int main()
{
    std::vector<int> vi{1, 1, 1, 2, 3, 3, 3, 4, 5};
    std::list<int> li;
    std::unique_copy(vi.begin(), vi.end(), std::inserter(li, li.begin()));

    for_each(li.begin(), li.end(), [](int x) {
            std::cout << x << std::endl;
            });
    return 0;
}
